package com.zr.model;
// Generated 2016-6-19 19:35:13 by Hibernate Tools 3.2.2.GA

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TGood generated by hbm2java
 */
@Entity
@Table(name = "t_good", catalog = "ld_sys")
public class TGood implements java.io.Serializable {

	private Integer gid;
	private TGoodstype TGoodstype;
	private String gname;
	private Integer gcount;
	private Integer weight;
	private Integer volume;
	private Set<TOrder> TOrders = new HashSet<TOrder>();

	public TGood() {
	}

	public TGood(TGoodstype TGoodstype, String gname, Integer gcount, Integer weight, Integer volume, Set<TOrder> TOrders) {
		this.TGoodstype = TGoodstype;
		this.gname = gname;
		this.gcount = gcount;
		this.weight = weight;
		this.volume = volume;
		this.TOrders = TOrders;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "gid", unique = true, nullable = false)
	public Integer getGid() {
		return this.gid;
	}

	public void setGid(Integer gid) {
		this.gid = gid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "gtid")
	public TGoodstype getTGoodstype() {
		return this.TGoodstype;
	}

	public void setTGoodstype(TGoodstype TGoodstype) {
		this.TGoodstype = TGoodstype;
	}

	@Column(name = "gname")
	public String getGname() {
		return this.gname;
	}

	public void setGname(String gname) {
		this.gname = gname;
	}

	@Column(name = "gcount")
	public Integer getGcount() {
		return this.gcount;
	}

	public void setGcount(Integer gcount) {
		this.gcount = gcount;
	}

	@Column(name = "weight")
	public Integer getWeight() {
		return this.weight;
	}

	public void setWeight(Integer weight) {
		this.weight = weight;
	}

	@Column(name = "volume")
	public Integer getVolume() {
		return this.volume;
	}

	public void setVolume(Integer volume) {
		this.volume = volume;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TGood")
	public Set<TOrder> getTOrders() {
		return this.TOrders;
	}

	public void setTOrders(Set<TOrder> TOrders) {
		this.TOrders = TOrders;
	}

}
